#ifndef __MATCHFLAG_H__
#define __MATCHFLAG_H__

#include "util/Pool.h"

class Request;
class MESICache;
class DataRequest;
class CacheEntry;
class SnoopRequest;
class Processor;

typedef enum {
    MATCH_INPUT_BUFFER,
    MATCH_CACHE_HASH,
    MATCH_MSHR,
    MATCH_OUTPUT_BUFFER,
    MATCH_OVERFLOW_MANAGER
} MatchFlag;

class MatchInfo {
  public:
    NEW_DELETE_OPERATORS_H(MatchInfo,NoSuper);  
    MatchInfo (MatchFlag _flag,
               Request* _r,
               MESICache* _location,
               DataRequest* _matchingRequest);
                
    MatchInfo (MatchFlag _flag,
               Request* _r,
               MESICache* _location,
               DataRequest* _matchingRequest,
               CacheEntry* _matchingEntry);

    MatchInfo (MatchFlag _flag,
               Request* _r,
               MESICache* _location);               

    MatchFlag     getFlag();
    const char*   getFlagName();
    MESICache*    getLocation();
    CacheEntry*   getMatchingEntry();
    DataRequest*  getDataRequest();
    Request*      getInternalRequest(); // evict or snooprequest
    bool isFromOverflowManager();
    Processor* getRequester();
    VA getAddr();
     
    MatchFlag flag;
    MESICache* location;
    CacheEntry* matchingEntry;
    DataRequest* dataRequest;
    Request* internalRequest;
};

#endif  //__MATCHFLAG_H__
